﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaiwuModFramework.Common.Abstract;

namespace TaiwuModFramework.Frontend.ConfigItemReader {
    public class IntReader : AConfigItemReader {
        public override Type ItemType() {
            return typeof(int);
        }

        public override object Read(string modIdStr ,string itemName) {
            int tmp = 0;
            ModManager.GetSetting(modIdStr, itemName, ref tmp);
            return tmp;
        }
    }


    public class FloatReader : AConfigItemReader {
        public override Type ItemType() {
            return typeof(float);
        }

        public override object Read(string modIdStr, string itemName) {
            float tmp = 0;
            ModManager.GetSetting(modIdStr, itemName, ref  tmp);
            return tmp;
        }
    }


    public class BoolReader : AConfigItemReader {
        public override Type ItemType() {
            return typeof(bool);
        }

        public override object Read(string modIdStr, string itemName) {
            bool tmp = false;
            ModManager.GetSetting(modIdStr, itemName, ref tmp);
            return tmp;
        }
    }


    public class StringReader : AConfigItemReader {
        public override Type ItemType() {
            return typeof(string);
        }

        public override object Read(string modIdStr, string itemName) {
            string tmp = null;
            ModManager.GetSetting(modIdStr, itemName, ref tmp);
            return tmp;
        }
    }


}
